export const toBreak = (val: string) => {
  return val.replaceAll(',', '<br />')
}

export function filterAsyncRoute(asyncRoute: any[], routes: any[]) {
  return asyncRoute.filter((item: any) => {
    if (routes.includes(item.name)) {
      if (item.children && item.children.length > 0) {
        //
        item.children = filterAsyncRoute(item.children, routes)
      }
      return true
    }
  })
}
